package com.example.film.service;

import com.example.film.entity.EachYearSell;
import com.example.film.mapper.EachYearSellMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EachYearSellServiceImpl implements EachYearSellService{

    @Autowired
    private EachYearSellMapper eachYearSellMapper;

    @Override
    public List<EachYearSell> findEachYearSellInfo(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return eachYearSellMapper.findEachYearSellInfo(startIndex,pageSize);
    }

    @Override
    public List<EachYearSell> findEachYearSellByYear(Integer year, Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return eachYearSellMapper.findEachYearSellByYear(year, startIndex, pageSize);
    }
}
